package com.sl.au.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
///
@Entity
@Table(name = "sl_au_account")
public class Account extends Root {

	
	@Column(nullable = false)
	private String accountName;
	@Column(nullable = false)
	private String password;
	@Column(nullable = false)
	private Boolean isEnabled;
	@Temporal(TemporalType.TIMESTAMP)
	private Date lastLoginDate;
	
	private String memo;
	
	private String registerOpenid;
	private String validateOpenid;
	
	public String getRegisterOpenid() {
		return registerOpenid;
	}

	public void setRegisterOpenid(String registerOpenid) {
		this.registerOpenid = registerOpenid;
	}

	public String getValidateOpenid() {
		return validateOpenid;
	}

	public void setValidateOpenid(String validateOpenid) {
		this.validateOpenid = validateOpenid;
	}

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	@OneToOne 
	@JoinColumn(unique = true)
	private User user;
	
	@OneToOne
	@JoinColumn(unique = false)
	private Role role;
	
	@Transient
	private EXDELoginInfo loginInfo;
	
	/***
	 * 虚拟验证码
	 */
	@Transient
	private String smsCode;
	
	public String getSmsCode() {
		return smsCode;
	}

	public void setSmsCode(String smsCode) {
		this.smsCode = smsCode;
	}

	public String getAccountName() {
		return accountName;
	}

	public void setAccountName(String accountName) {
		this.accountName = accountName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Boolean getIsEnabled() {
		return isEnabled;
	}

	public void setIsEnabled(Boolean isEnabled) {
		this.isEnabled = isEnabled;
	}

	public Date getLastLoginDate() {
		return lastLoginDate;
	}

	public void setLastLoginDate(Date lastLoginDate) {
		this.lastLoginDate = lastLoginDate;
	}

	public Role getRole() {
		return role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public EXDELoginInfo getLoginInfo() {
		return loginInfo;
	}

	public void setLoginInfo(EXDELoginInfo loginInfo) {
		this.loginInfo = loginInfo;
	}

}
